﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Diagnostics;
using System.Text;

using System.Windows.Forms;

namespace Tools {
	/// <summary>
	/// Holds static global variables and methods
	/// </summary>
	public static class Globals {
		public static void SetDoubleBuffered( Control c ) {
		   if( System.Windows.Forms.SystemInformation.TerminalServerSession )
			  return;

		   System.Reflection.PropertyInfo aProp = 
				typeof(System.Windows.Forms.Control).GetProperty(
					"DoubleBuffered", 
					System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance
				);

		   aProp.SetValue( c, true, null ); 
		}

		// ----------

		/// <summary>
		/// The current assets path.
		/// </summary>
		public static string AssetsPath { get; set; }

		public static bool ShowMask { get; set; }

		public static bool ShowOutline { get; set; }

		public static bool PixelGrid { get; set; }

		public static int StartSnapSize { get; set; }

		public static int ExpandSnapSize { get; set; }

		public static Dictionary<string,int> Extensions { get; set; }
	}
}
